﻿using BootyBay.PrivateStoreApp.DataModel;
using BootyBay.PrivateStoreApp.ViewModels;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// “用户控件”项模板在 http://go.microsoft.com/fwlink/?LinkId=23423itemGridView_ItemClick6 上提供

namespace BootyBay.PrivateStoreApp.Controls
{
    public sealed partial class FlipViewControl : UserControl
    {
        public FlipViewControl()
        {
            this.InitializeComponent();
            this.DataContext = AppDetailPageVM.Instance;
        }
        private void itemFlipView_Loaded(object sender, RoutedEventArgs e)
        {
            if (itemFlipView.ItemsSource == null || itemGridView.Items.Count == 0)
            {
                itemFlipView.Visibility = Visibility.Collapsed;
            }
        }

        private void rad_Button_Checked(object sender, RoutedEventArgs e)
        {
            RadioButton rad = sender as RadioButton;
            rad.Opacity = 0.8;
            itemFlipView.SelectedIndex = Convert.ToInt32(rad.Tag);
        }
    }
}
